
#include "stdafx.h"
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void daozhi(int a[4][4], int n, int m)
{
	for (int i = 0; i<n; i++)
	{
		for (int j = 0; j<m; j++)
		{
			cout << a[n - 1 - j][i] << " ";
		}
		cout << endl;
	}
}
void daozhi3(int a[4][4], int n, int m)
{
	for (int i = 0; i<n; i++)
	{
		for (int j = 0; j<m; j++)
		{
			cout << a[j][4 - 1 - i] << " ";
		}
		cout << endl;
	}
}
void daozhi2(int a[4][4], int n, int m)
{
	for (int i = 0; i<n; i++)
	{
		for (int j = 0; j<m; j++)
		{
			cout << a[n - 1 - i][n - 1 - j] << " ";
		}
		cout << endl;
	}
}
int main(void)
{
	int a[4][4] =
	{
		{1, 2, 3, 4},
		{9, 10, 11, 12},
		{13, 9, 5, 1}, 
		{15, 11, 7, 3}
	};


	int col = 4, row = 4;
	daozhi(a, row, col);
	cout << endl;
	daozhi2(a, row, col);
	cout << endl;
	daozhi3(a, row, col);
	return 0;
}
